//
//import java.util.Scanner;
//
//public class Main {
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int n = scanner.nextInt();
//        double[][] dp = new double[n+1][2];
//        long[] x = new long[n+1];
//        long[] a = new long[n+1];
//        long[] b = new long[n+1];
//
//        for(int i = 1; i<=n; i++) {
//            x[i] = scanner.nextLong();
//        }
//
//        for(int i = 1; i<n; i++ ) {
//            a[i] = scanner.nextLong();
//            b[i+1] = scanner.nextLong();
//        }
//        a[0] =  Long.MAX_VALUE;
//        dp[1][0] = dp[1][1] =  x[1];
//
//        for(int i = 2;i<=n; i++) {
//            double ans1 = dp[i-1][0] + x[i] - x[i-1];
//            double ans2 = dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1]-b[i-1])/0.7 : (b[i-1] - a[i-1])/1.3) + b[i]/1.3;
//            double ans3 = dp[i-1][0] + x[i] - x[i-1] + b[i]/0.7;
//            double ans4 = dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1] - b[i-1])/0.7 : (b[i-1] - a[i-1]) / 1.3);
//
//            dp[i][0] = Math.min(dp[i-1][0] + x[i] - x[i-1],
//                    dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1]-b[i-1])/0.7 : (b[i-1] - a[i-1])/1.3) + b[i]/1.3);
//            dp[i][1] = Math.min(dp[i-1][0] + x[i] - x[i-1] + b[i]/0.7,
//                    dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1] - b[i-1])/0.7 : (b[i-1] - a[i-1]) / 1.3));
//        }
//
//        double ret  =  Math.min(dp[n][0], dp[n][1] + b[n]/1.3);
//        System.out.printf("%.2f", ret);
//    }
//}




import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        double[][] dp = new double[n+1][2];
        long[] x = new long[n+1];
        long[] a = new long[n+1];
        long[] b = new long[n+1];

        for(int i = 1; i<=n; i++) {
            x[i] = scanner.nextLong();
        }

        for(int i = 1; i<n; i++ ) {
            a[i] = scanner.nextLong();
            b[i+1] = scanner.nextLong();
        }
        dp[1][0] = dp[1][1] =  x[1];

        for(int i = 2;i<=n; i++) {
            dp[i][0] = Math.min(dp[i-1][0] + x[i] - x[i-1],
                    dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1]-b[i-1])/0.7 : (b[i-1] - a[i-1])/1.3) + b[i]/1.3);
            dp[i][1] = Math.min(dp[i-1][0] + x[i] - x[i-1] + b[i]/0.7,
                    dp[i-1][1] + (a[i-1] > b[i-1] ? (a[i-1] - b[i-1])/0.7 : (b[i-1] - a[i-1]) / 1.3));
        }

        double ret  =  Math.min(dp[n][0], dp[n][1] + b[n]/1.3);
        System.out.printf("%.2f", ret);
    }
}
